package makex

import (
	"fmt"
	"time"

	"github.com/gookit/color"
)

type Make struct {
}

// slice, map, or chan (only)
func (p Make) arr() {
	var ok = make([]int, 0)
	fmt.Println(ok, ok == nil, len(ok))
	ok = append(ok, 1, 2)
	fmt.Println(ok)
}

func (p Make) mapx() {
	var ok map[int]any = make(map[int]any, 1) //nil
	color.Greenln(ok, ok == nil, len(ok))
	ok[1] = "as"
	color.Greenln(ok)
}
func (p Make) chanx() {
	var ok = make(chan int, 0)
	go func() {
		color.Yellowln(<-ok)
	}()
	ok <- 1
	time.Sleep(time.Second)
}
